package com.ailot.cloud.upms.common.dto;

import com.ailot.cloud.upms.common.entity.SysOrg;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * @author 机构树
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class OrgTree extends TreeNode {
    private String name;
    /**
     * 机构编码
     */
    private String code;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 机构类型
     */
    private String type;
    /**
     * 电话
     */
    private String phone;
    /**
     * 地址
     */
    private String address;
    /**
     * 备注
     */
    private String remarks;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    public OrgTree(SysOrg sysOrg) {
        this.id = sysOrg.getId();
        this.parentId = sysOrg.getParentId();
        this.name = sysOrg.getName();
        this.code = sysOrg.getCode();
        this.type = sysOrg.getType();
        this.phone = sysOrg.getPhone();
        this.sort = sysOrg.getSort();
        this.address = sysOrg.getAddress();
        this.remarks = sysOrg.getRemarks();
        this.createTime = sysOrg.getCreateTime();
        this.updateTime = sysOrg.getUpdateTime();
    }
}
